import com.dao.UserDao1;
import com.po.User;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

/**
 * @author yunfeng
 * @create 2021-05-04 21:25
 * 目的测试是否能连接到数据库并且能读取到数据
 **/
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations  ={"classpath:applicationContext.xml"})
public class testdemo {
    @Autowired
    private User user;
    @Autowired
    private UserDao1 userDao1;;
    @Test
    public void test(){
        System.out.println(userDao1.selectUserByname("zhang","123456").toString());
    }
}
